Return to start page

Core/Interface/Library Trackable.j

Code

		
1			library ALibraryCoreInterfaceTrackable
2
3 /// Auf WC3Jass.com wurde die lokale Erzeugung ebenfalls so angewandt.
4 function CreateTrackableForPlayer takes player user, string modelPath, real x, real y, real facingAngle returns trackable
5 local player localPlayer = GetLocalPlayer()
6 local string localPath = ""
7 if (user == localPlayer) then
8 set localPath = modelPath
9 endif
10 set localPlayer = null
11 return CreateTrackable(localPath, x, y, facingAngle)
12 endfunction
13
14 /**
15 * This creates a trackable at the given coordinates that floats above the ground with the height specified by z.
16 * It works by creating an invisible platform, creating the trackable and removing the platform again.
17 * This function is extra since it uses more memory and isn't always required.
18 * @author KaTTaNa
19 * @source http://www.wc3jass.com/
20 */
21 function CreateTrackableForPlayerZ takes player whichPlayer, string modelPath, real x, real y, real z, real facingAngle returns trackable
22 local destructable heightDestructable = CreateDestructableZ('OTip', x, y, z, 0.0, 1.0, 0)
23 local trackable whichTrackable = CreateTrackableForPlayer(whichPlayer, modelPath, x, y, facingAngle)
24 call RemoveDestructable(heightDestructable)
25 set heightDestructable = null
26 return whichTrackable
27 endfunction
28
29 endlibrary